
import { getTopCategoryAPI } from "@/apis/category";
import { useRoute } from "vue-router";
import { onMounted, ref } from "vue";
export function useCategory(){
const route = useRoute();
const categoryData = ref({});
const getCategory = async () => {
  const res = await getTopCategoryAPI(route.params.id);
  console.log(res);
  categoryData.value = res.result;
};
onMounted(()=>getCategory())

return{
    categoryData
}
}